package cn.wolfcode.ssm.mapper;

import cn.wolfcode.ssm.domain.Employee;
import cn.wolfcode.ssm.query.EmployeeQueryObject;
import cn.wolfcode.ssm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    void insert(Employee record);

    void updateByPrimaryKey(Employee record);

    void deleteByPrimaryKey(Long id);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int totalcount(QueryObject qo);

    List<Employee> result(QueryObject qo);

    void insertReslation(@Param("eid") Long eid, @Param("rid") Long rid);

    void deleteReslation(Long eid);

    Employee selectedByUsernameAndPassword(@Param("username") String username, @Param("password") String password);



    String updatePwd(Long id);

    void updatePassword(@Param("id") Long id, @Param("newPassword") String newPassword);

    void resetPwd(@Param("newPassword") String newPassword, @Param("userId") Long userId);

    void batchDelete(Long[] ids);

    Employee checkName(String name);

    String selectById(Long id);

    void updateStatus(Employee employee);

    // 查询带有指定角色编码的员工...代表可变参数
    List<Employee> selectByRoleSn(String... sns);
}